package com.xuecheng.content.interfaces.web;

import com.xuecheng.content.application.service.CourseCategoryApplication;
import com.xuecheng.content.domain.model.dto.CourseCategoryTreeDto;
import com.xuecheng.content.domain.model.enums.CourseCategoryEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: LiJunXi
 * @Description:
 * @Date: 2024-07-26  16:36
 */
@Api(tags = "课程分类接口")
@RestController
public class CourseCategoryApi {

    @Autowired
    private CourseCategoryApplication courseCategoryApplication;

    @ApiOperation("查询课程分类")
    @GetMapping("/course-category/tree-nodes")
    public List<CourseCategoryTreeDto> queryTreeNodes(){

        return courseCategoryApplication.queryTreeNodes(CourseCategoryEnum.ROOT.getId());
    }
}
